<?php 
	session_start();
//var_dump($_SESSION);exit;
?>
<head>
	
	<meta charset="utf-8" />
	<title>YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证</title>
	<link rel="stylesheet" type="text/css" href="h.css">
</head>
	<body>
		<div id=nav>
			<ul class=quick-menu>
						<li class=home><a href="../YOHO PJ1/index.php">HI~</a> </li>
						<?php if(empty($_SESSION['user']['id'])):?>
						<li><a href="../denglu/denglu.php">[请登录]</a></li> 
						<li><a href="../zhuce/zhuce.php">[免费注册]</a></li>
						<?php else:?>
						<li>欢迎<a href="../ucenter/ucenter.php"><?php echo $_SESSION['user']['username']?></a></li> 
						<li><a href="../denglu/denglu.php?a=logout">退出</a></li> 
						<?php endif;?>			
						<li class="mytaobao menu-item">
							<div class=menu>
								<a class=menu-hd href="#">MY有货<b></b></a> 
								<div class=menu-bd>
									<div class=menu-bd-panel>
										<div>
											<a href="../ucenter/ucenter.php">我的订单</a> 
										</div>
									</div>
									<s class=r></s><s class=rt></s><s class=lt></s><s class=b></s><s class="b b2"></s><s class=rb></s><s class=lb></s>
								</div>
							</div>
						</li>
				<li class=cart><a href="../shoppingcar/shoppingcar.php"><s></s>购物车 </a></li>
				<li class=favorite><a href="#">我的收藏</a></li>
				<li class=favorite><a href="#">消息</a></li>
			
				<li class="services menu-item last">
					<div class=menu>
						<a class=menu-hd href="#">手机版<b></b></a> 					
					</div>
					<div class=menu-bd style="width: 210px; height: 262px; _width: 202px">
						<div class=menu-bd-panel>
							 
						</div>
					</div>
				</li>
			</ul>
		</div>
		<div id="main-logo">
			<a href="../YOHO PJ1/index.php"><img src="logo_e.png"></a>
		</div>
		<div id="main-nav-list">
			<ul>
				<li class="black">
					<a href=""><h3>男生</h3></a>
					<a href=""><h3>BOYS</h3></a>
				</li>
				<li class="b2">
					<a href=""><h3>女生</h3></a>
					<a href=""><h3>GIRLS</h3></a>
				</li>
				<li class="b3">
					<a href=""><h3>潮童</h3></a>
					<a href=""><h3>KIDS</h3></a>
				</li>
				<li class="b4">
					<a href=""><h3>创意生活</h3></a>
					<a href=""><h3>LIFE STYLE</h3></a>
				</li>
			</ul>
		</div>
		<div id="search">
				<input maxlength=60 name=q><button type=submit>搜索</button> 
				<input type=hidden value=newsearch name=shopf> 
		</div>
		
		<div id="logolist">
			
			<ul class='yyy'>
			<?php
				//1 导入配置文件 
				include("../../../public/dbconfig.php");  //这里真的搞!
				//2 连接数据库
				$link = @mysqli_connect(HOST,USER,PASS) or die("数据库连接失败");
				//3 选择数据库 设置字符集
				mysqli_set_charset($link,"utf8");
				mysqli_select_db($link,DBNAME);
				//商品类别表里面的一级类别遍历出来 
				$sql = "select * from type where pid=0";
				$result = mysqli_query($link,$sql);//成功是结果集对象 失败false
				if($result){ 
					while($row = mysqli_fetch_assoc($result)){
						//print_r($row);die;
						echo "<li><a href='#'>{$row['name']}</a>";
						
						$sql_1 = "select * from type where pid={$row['id']}";
						//echo $sql_1;die;
						$result_1 = mysqli_query($link,$sql_1);
						//var_dump($result_1);die;
						if($result_1){
							echo "<ul>";
							while($list = mysqli_fetch_assoc($result_1)){
								//var_dump($list);die;
								echo "<li><a href='../list/list.php?typeid={$row['id']}'>{$list['name']}</a></li>";
								
							}
							echo "</ul>";
						}
						echo '</li>';
						
						
					}
				}
			?>
			</ul>
		</div>
	</body>						